All Functions of Week 1

chisq.test

{stats}

Chi-Squared test (e.g. for cross-tabulations)

ifelse

{base}

Return a or b depending on the value of test

cut

{base}

Convert Numeric to Factor

summary

{base}

Obtain summary statistics or detailed regression output

library

{base}

Load an R package

table

{base}

Obtain frequency table of a variable/cross-tabulation of two variables

setwd

{base}

Set Working Directory

c

{base}

Combine values/vectors into a vector

ordered

{dplyr}

Create an ordered factor

read_dta

{haven}

Read a .dta file (Stata data)

with

{base}

evaluate expression in the context of a data frame

mutate

{dplyr}

Modify/create a column in a data frame

The end!